home *** CD-ROM | disk | FTP | other *** search
/ Digit Magazine 1999 December / cDigit issue 18 - December 1999.iso / pc / demos / GLpro / project.exe / %MAINDIR% / Include / startup.GLs < prev   
Encoding:
Text File  |  1999-10-05  |  5.9 KB  |  128 lines

  1. ;Script startup.GLs
  2. ;Last modified by JASON at 15/09/99 15:06:42
  3.  
  4. ;----- In this project the conventions that have been adopted are:
  5. ;
  6. ;     Global variables are predefined with a "g" i.e gintMAX
  7. ;    All variables within GLPRO are varients (i.e. integers can be treated as numbers and vice versa)
  8.  
  9. ;     To explore the functionality of any of the commands that you see in the project (By default in dark blue)
  10. ;    place the cursor on them and press F1 to launch the GLPRO help file at the command in question.
  11.  
  12. ;------Set the working environment
  13.     ; windowSTYLE sets the style for the main window i.e. double border, minimize buttons etc.
  14.     ; try:
  15.     ;windowSTYLE popup dlgframe 
  16.     ;windowSTYLE minimize maximize sysmenu
  17.     
  18.     windowSTYLE popup
  19.  
  20.     ; winbackground sets the background windows for the GLPRO application
  21.     ; if this line is commented out then the main screen will appear
  22.     windowBACKGROUND black
  23.  
  24.     ; Wintitle defines the caption to appear in the task list for the application
  25.     windowTITLE "GLPRO Demonstration Project"
  26.     
  27.     ; The video command sets the screen size for the application and the color depth
  28.     ; for example the line below creates a 640x480 pixel window in 8-bit (256 color) resolution
  29.     windowSIZE 640 480 8
  30.     
  31.     ; the palette command sets the palette for the application window
  32.     palette back
  33.  
  34.     ; The merge command joins another file to the current script. This file typically contains frequently
  35.     ; used procedures
  36.     scriptMERGE common.GLs
  37.     
  38.     ; --- Hotspotlayer, AbortAnim,and AscynTigger are some of GLPROs environment variables
  39.     ; check out the help file by placing your cursor on a command and pressing "F1"
  40.     Set layerHOTSPOT on
  41.     Set animABORT on
  42.     Set whenBACKGROUND Off
  43.     
  44.     ;-- this is setting "gintCurrentSection" as a global variable with the value "0" 
  45.     Global gintCurrentSection 0
  46.     
  47.     ;-----Set the cursor to be used in the application
  48.     mouseCURSOR arrow
  49.     ;----- Mouse hotcursor defines how the cursor will look when over an active (i.e. HOT) area of the screen
  50.     mouseCUSTOMHOT hd 3 6 hdmsk
  51.  
  52.     ;-----Show the main background image "Back" with a fade "vwipeout" check-out fades in the help file
  53.     ; for others.
  54.     imageFADE vwipeout Back
  55.  
  56.     ;-----load the introduction animation (title.dff) into the variable anmTitle
  57.     animLOAD title.GLa anmTitle
  58.     ;---- play the animation (speed 5)
  59.     animPLAY anmTitle 5
  60.     ;---- free the animation
  61.     animFREE anmTitle
  62.     ;---- cgetbuf grabs an area of the screen as defined by the coordinates below the image
  63.     ; is placed into the variable "menu_button_buffer" this can then be displayed using putup, cfade, cfadexy etc
  64.     imageGETCLIP menu_button_buffer 18,60,157,286
  65.  
  66.     ;-- winfontstyle sets the style to be used on creating a font within GLPRO from a TTF in Windows
  67.     ; in this case we "init" intialise the style to get rid of any previously set in GLPRO
  68.     ; "bold" "italic" are self explanitory and "anti" means the font will antialias to the background image
  69.     fontSTYLE init bold italic anti
  70.     
  71.     ; the font is chosen as "Arial" size 22 and stored in the variable head_fnt
  72.     fontDEFINE head_fnt "Arial" 16
  73.     
  74.     ;--- the current font is set to be the newly created font "head_fnt"
  75.     font head_fnt
  76.     
  77.     ;- the current foreground color is set to white and background color to black
  78.     ; we need a background color as we are going to put a drop shadow on the text
  79.     color white black
  80.  
  81.     ; fstyle sets the pitch and offset of the drop shadow
  82.     fontSHADOW 8 2 2
  83.  
  84.     ; the window command defines a region of the main screen to draw into
  85.     ; this means that the only part of the screen that will be updated while
  86.     ; a "window" is defined inside this region
  87.     drawREGION 216,120,585,408
  88.         ; "set left on" will set any text drawn to the screen as left justified
  89.         ; the other two style are "right" and "center"
  90.         set textLEFT on
  91.         ; text command draws text to the screen "@crlf" adds a hard return to the end of the line
  92.         ; the "$" is used to join to variables/strings
  93.         text "Using this project:"$@crlf
  94.         ; @texty is a GLPRO variable that holds the current y-screen coordinated of where the text will
  95.         ; draw next "local y" is setting a local variable y equal to the "@texty" value
  96.         local y @textPOSy
  97.     ; just using "window" by itself resets the "window" area to the entire screen
  98.     drawREGION
  99.     ; free the font "head_fnt" ffree is specific to fonts i.e. fontFREE 
  100.     ; you can use wild cards in free any object i.e. ffree "head*" would free all font variable that started with "head"
  101.     fontFREE head_fnt
  102.  
  103.     ; define and set another font as above
  104.     fontSTYLE init bold anti
  105.     fontDEFINE body_fnt "Arial" 14
  106.     font body_fnt
  107.  
  108.     ;fgaps changes the leading, kerning and tracking of the currently set font i.e. "body_fnt"
  109.     fontGAPS , , ,-3 ;- The first to values are missed and the third is used to reduce the line spacing
  110.     
  111.     ;define another screen area using the "y" value previously stored
  112.     drawREGION 226,@y+10,585,408
  113.         ; the "1" at the end of the text line means that it is drawn with delay 1
  114.         text "This sample project has been created to demonstrate the flexability and power of GLPRO."@crlf
  115.         text @crlf
  116.         text "The code is fully commented so feel free to explore by changing values and experimenting with different commands. You are safe in the knowledge that if things go really bad then you only have to re-install this sample project and start again."
  117.         text @crlf@crlf
  118.         text "Clicking on any ^yellow^GLPRO command^white^ or ^yellow^system variable^white^ and pressing the "$@quote$"F1"$@quote$" key for help will give you a complete definition of the command and specific examples of how it can be used."
  119.         text @crlf@crlf
  120.         text "The help file also gives you lots of general examples of different ways in which the large range of commands and system variables can be used."
  121.     drawREGION
  122.  
  123.     ;-----Setup the menu by calling a common sub-routine "CreateMenuHotspots" this is contained 
  124.     ; in the COMMON.TXT script as we will be needing it in other scripts/sections of the program
  125.     gosub CreateMenuHotspots
  126.  
  127. FOREVER
  128.